<% layout('/layouts/default.html', {title: '出入库单管理', libs: ['validate','dataGrid']}){ %>
<script src="https://cdn.bootcdn.net/ajax/libs/bignumber.js/9.0.1/bignumber.js"></script>
<div class="main-content">
	<div class="box box-main">
			<div class="box-body">
				<div class="row">
					<#form:form id="inputForm" model="${bean}">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('库存数量')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="warehouseNumber" maxlength="20" class="form-control" readonly="true"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('需要数量')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="needNumber" maxlength="20" class="form-control" readonly="true" readonly="true"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('包装规格')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="packType" maxlength="20" class="form-control" readonly="true" readonly="true" defaultValue="25"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('领料数量')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="getNumber" maxlength="20" class="form-control digits"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('领料件数')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="caseNumber" maxlength="20" class="form-control digits"/>
							</div>
						</div>
					</div>
					</#form:form>
					<script>
						$("#getNumber").bind("input propertychange", function () {
							var n1 = new BigNumber($("#getNumber").val());
							var n2 = new BigNumber($("#packType").val());
							var res = n1.div(n2).toNumber();
							$("#caseNumber").val(res);
						});
						$("#caseNumber").bind("input propertychange", function () {
							var n1 = new BigNumber($("#caseNumber").val());
							var n2 = new BigNumber($("#packType").val());
							var res = n1.times(n2).toNumber();
							$("#getNumber").val(res);
						});

					</script>

				</div>
			</div>
<!--			<div class="box-footer">-->
<!--				<div class="row">-->
<!--					<div class="col-sm-offset-2 col-sm-10">-->
<!--						<% if (hasPermi('st:stInventoryBill:edit')){ %>-->
<!--							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>&nbsp;-->
<!--						<% } %>-->
<!--						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>-->
<!--					</div>-->
<!--				</div>-->
<!--			</div>-->
	</div>
</div>
<% } %>
<script>
    function commit() {

		return {getNumber: $("#getNumber").val(), caseNumber: $("#caseNumber").val()};
    }
</script>